{% extends "admin/change_form.html" %}

{% block after_field_sets %}
<script>
// 强制设置表单为 multipart 编码以确保文件提交
document.addEventListener('DOMContentLoaded', function() {
  var form = document.querySelector('form');
  if (form) {
    form.setAttribute('enctype', 'multipart/form-data');
    form.setAttribute('encoding', 'multipart/form-data');
  }
});
</script>
{% endblock %}